<template>
  <div class="container-big">
    <div style="padding-bottom: 336px;" class="container">
      <co-list style="padding:16px ;" margin>
        <co-list-item>
          <span>绑定手机号</span>
          <span class=" cenCen" slot="right">
            {{phone}}
          </span>
        </co-list-item>
      </co-list>
    </div>
    <div class="screen-fixed-box cenCen ">
      <div style="background: #313339;width: 100%;" class="goods-box cenBet">
        <co-button @click="signOut()" block color="primary">
          退出登录
        </co-button>
      </div>
    </div>
  </div>
</template>
<script>
import { setCookie } from "@/router/publicJs/setCookie";
import { jwtFun } from "@/router/publicJs/jwt";
export default {
  data() {
    return {
      phone: ""
    };
  },
  created() {
    this.initFun();
  },
  methods: {
    async initFun() {
      this.phone = (await jwtFun()).linkphone;
    },
    async signOut() {
      const res = await this.$confirm(`您确定要退出登录？`, {
        title: "温馨提示",
        okLabel: "退出登录",
        showCancel: true
      });
      if (!res) {
        return;
      }
      if (setCookie("TK", "", -1)) {
        this.$router.replace({
          name: "signin"
        });
      }
    }
  }
};
</script>
<style scoped>
.goods-box {
  z-index: 9;
  width: 100%;
  height: auto;
  padding: 0px;
  min-height: 110px;
  background: #35383f;
  box-shadow: 0 -10px 17px 0 rgba(0, 0, 0, 0.1);
}
</style>
